package br.mikhas.lab.scanner;

import java.util.Arrays;

public class AcceptMultipleTransition extends Transition {

	private final char[] accepted;

	public AcceptMultipleTransition(State state, char[] accepted) {
		super(state);
		Arrays.sort(accepted);
		this.accepted = accepted;
	}

	@Override
	boolean accept(char c) {
		return Arrays.binarySearch(this.accepted, c) >= 0;
	}

}
